﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using PoemGame.WebDemoApplication;
using PoemGame.WebDemoApplication.DTOs;

namespace PoemGame.WebDemoApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class GameController : ControllerBase
    {
        private readonly IPoemGameWebDemoApplication app;
        public GameController(IPoemGameWebDemoApplication app)
        {
            this.app = app;
        }

        [HttpPost("CreateGame")]
        public async Task<CreateGameResult> CreateGame(CreateGameInputDto dto)
        {
            var res = await app.CreateGame(dto);
            return res;
        }

        [HttpPost("Play")]
        public async Task<PlayResult> Play(PlayInputDto dto)
        {
            var res = await app.Play(dto);
            return res;
        }
    }
}
